This repository was archived by the owner on Jul 24, 2024. It is now read-only.
Update dependency phpstan/phpstan to v0.12.100 #10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
0.12.83->0.12.100Release Notes
phpstan/phpstan (phpstan/phpstan)
v0.12.100Compare Source
Message from the future
The last release in the 0.12.x series with new features
and bugfixes was released on September 12th 2021,
that's 415 days ago.
Since then more than 67 new PHPStan versions were released
with hundreds of new features, bugfixes, and other
quality of life improvements.
To learn about what you're missing out on, check out
this blog with articles about the latest major releases:
https://phpstan.org/blog
Upgrade today to PHPStan 1.8 or newer by using
"phpstan/phpstan": "^1.8"in yourcomposer.json.v0.12.99Compare Source
Improvements 🔧
CompoundTypeHelperis deprecated (phpstan/phpstan-src@fff85f3)phpstorm-stubs(phpstan/phpstan-src@6fa1285)Bleeding edge 🔪
empty()rule (phpstan/phpstan-src@601460c)MissingReturnRule- make the error non-ignorable for native typehints (phpstan/phpstan-src@9ecefd5)array_map()andarray_filter()calls, #5609, #5356, #1954IssetRuleeverything whatVariableCertaintyInIssetRuledoes (phpstan/phpstan-src@9689fbd), #970CatchWithUnthrownExceptionRuleeverything whatDeadCatchRuledoes (phpstan/phpstan-src@165504c)@throws voiddoes not have an explicit throw point (phpstan/phpstan-src@8b3382a)If you want to see the shape of things to come and adopt bleeding edge features early, you can include this config file in your project's
phpstan.neon:Of course, there are no backwards compatibility guarantees when you include this file. The behaviour and reported errors can change in minor versions with this file included. Learn more
Bugfixes 🐛
checkExplicitMixed- replace mixed type recursively (phpstan/phpstan-src@b4f81db), #5218checkExplicitMixedwithTemplateMixedType(phpstan/phpstan-src@6ba9ef2), #3566BaselineNeonErrorFormatter: Sort errors by normalized relative path (#536), #5085, thanks @dktapps!StubSourceLocatorFactory- always use PHP 8 parser for PhpStorm stubs (phpstan/phpstan-src@731ce1d)IntegerRangeType(#669), thanks @staabm!array_map- understand call with multiple arrays (phpstan/phpstan-src@3e0ecec), #5039range()ofnumeric-strings can produce array of float|int (phpstan/phpstan-src@3b6f0bf)Function signature fixes 🤖
Grpc\ChannelCredentials::createSsl(#665), thanks @howyi!SimpleXMLElementstub more specific (#666), thanks @devbanana!v0.12.98Compare Source
Allow dynamic list of stub files thanks to StubFilesExtension (phpstan/phpstan-src@2ba9332), https://github.com/phpstan/phpstan-symfony/issues/195
v0.12.97Compare Source
Improvements 🔧
literal-stringPHPDoc type inspired byis_literal()RFC (https://wiki.php.net/rfc/is_literal), #5507boolas template type bound (phpstan/phpstan-src@9d191f9)floatas template type bound (phpstan/phpstan-src@4e7d6c1), #5331ReflectionAttributegeneric (#640, #643), thanks @vhenzl!non-empty-arraytype in[] != $arrconditions (#649), thanks @staabm!Bugfixes 🐛
self::CONSTANTcan be precise even with PHPDoc type (phpstan/phpstan-src@5010ef4), #5517Text.phpofnl_BEfrom Faker (phpstan/phpstan-src@a09a98d), #5525?parentin return type (phpstan/phpstan-src@30c9b01), #5529__callStatic()in the class (phpstan/phpstan-src@114a38f), #5536sizeof()as alias ofcount()for Smaller/SmallerOrEqual (#647, #648), #4843, thanks @staabm!TemplateUnionType((phpstan/phpstan-src@1b5710a), #5562Function signature fixes 🤖
non-empty-array(#633), thanks @staabm!sodium_base642bin()is optional. (#644), thanks @tehbeard!filter_var()returnnon-empty-stringif input is non-empty (#642), thanks @devbanana!iterator_count()/iterator_apply()(#646), thanks @staabm!array_count_values()(#645), thanks @staabm!filter_var()should return non empty string only when it will not be sanitized (#650), thanks @devbanana!parse_urlsignature with PHP 8 (phpstan/phpstan-src@f7c6464)v0.12.96Compare Source
PHP_WINDOWS_*constants todynamicConstantNames(phpstan/phpstan-src@9762d37)v0.12.95Compare Source
Improvements 🔧
@varabove class constants (phpstan/phpstan-src@b932769), #4361, #3530TypeCombinator::CONSTANT_SCALAR_UNION_THRESHOLD(phpstan/phpstan-src@c56d866), #5447, #5454, #4925, #4793, #5062, #3366, #3555TypeCombinator::union()- new optimization for constant scalar types (phpstan/phpstan-src@da9e061)PhpPropertyReflection::hasPhpDoc()(phpstan/phpstan-src@d78d60a)Bleeding edge 🔪
static::(phpstan/phpstan-src@bad2607)static::(phpstan/phpstan-src@d8e8953)static::(phpstan/phpstan-src@270326a)If you want to see the shape of things to come and adopt bleeding edge features early, you can include this config file in your project's
phpstan.neon:Of course, there are no backwards compatibility guarantees when you include this file. The behaviour and reported errors can change in minor versions with this file included. Learn more
Bugfixes 🐛
DateTime|DateTimeInterfaceunion acceptsDateTimeInterface(#586), thanks @VincentLanglet!parallel.processTimeout10x bigger (phpstan/phpstan-src@abb4378), #5341ZEND_dynamic constants (#613), thanks @dktapps!PDOStatementimplementsIteratorAggregateon PHP 8 (phpstan/phpstan-src@dec054d), #5436non-empty-string(phpstan/phpstan-src@6a33de9), #5372non-empty-stringarray key type (phpstan/phpstan-src@7172e5f), #5372TemplateTypeMap::isEmpty()(phpstan/phpstan-src@f7250db)Function signature fixes 🤖
chr()(#599), thanks @AIlkiv!imagejpegGD function (#619), thanks @mauriciofauth!openssl_seal()$ivparameter (#624), thanks @jlherren!pg_field_nameprototype (#626), thanks @thierry-f-78!Phar/PharData::extractTotype information (#628), thanks @Seldaek!abs()return-type (#629), thanks @staabm!str_split()length parameter is always positive (#631), thanks @staabm!non-empty-arrayfrommb_str_split/str_split(#632), thanks @staabm!non-empty-stringin more string fuctions (#606), #5350, thanks @staabm!rand()dynamic return type extension (#606), thanks @staabm!WeakMap(#623), thanks @dktapps!#[ReturnTypeWillChange]stub (#618), thanks @zonuexe!non-empty-arrayinarray_map()(#601), thanks @Lctrs!mb_substitute_character(#607), thanks @TRowbotham!strlen: cover more scalar types (#630), thanks @staabm!min()/max()for two arguments (#627), #5072, thanks @staabm!array_fill(): handle negative cases, support integer ranges andnon-empty-array(#603), thanks @staabm!v0.12.94Compare Source
Improvements 🔧
non-empty-arrayinarray_flip(#583), thanks @staabm!nikic/php-parserto 4.12.0 (phpstan/phpstan-src@dca48f3)readonlyproperty (PHP 8.1) (phpstan/phpstan-src@c19506b)finalclass constant (PHP 8.1) (phpstan/phpstan-src@092d8e3)checkDependenciesOfProjectExtensionFiles(#595), #5296, thanks @janedbal!Bleeding edge 🔪
@finalclasses (phpstan/phpstan-src@dffd2c2), https://github.com/phpstan/phpstan/discussions/5343If you want to see the shape of things to come and adopt bleeding edge features early, you can include this config file in your project's
phpstan.neon:Of course, there are no backwards compatibility guarantees when you include this file. The behaviour and reported errors can change in minor versions with this file included. Learn more
Bugfixes 🐛
Memcache::get()andMemcachePool::get()(phpstan/phpstan-src@c5f9d24)@throws void(phpstan/phpstan-src@da3790e), #5364rulesin config.neonfile (#594), thanks @janedbal!Function signature fixes 🤖
SplFixedArray(#588), thanks @dktapps!proc_open()acceptslist<string>for$commandin 7.4+ (#590), thanks @dktapps!v0.12.93Compare Source
Improvements 🔧
non-empty-string:implode()fornon-empty-stringreturn type (phpstan/phpstan-src@520ae22), #5291non-empty-string(phpstan/phpstan-src@1283db7), #5301non-empty-stringinarray_mapclosure (phpstan/phpstan-src@b864a95), #5293non-empty-stringwhen given one (phpstan/phpstan-src@4a9e069)str_pad()function return type extension (phpstan/phpstan-src@84503ce), #5307str_repeat()function return type extension (phpstan/phpstan-src@57d765f), #5307htmlentities()(#574) (#574), thanks @staabm!substr(#577), thanks @staabm!DateTimeImmutableremoved fromDateTimeInterfaceresults inDateTime(phpstan/phpstan-src@5eb96f5), #5259non-empty-arrayinarray_combine(#578), thanks @staabm!non-empty-arrayinarray_merge(#581), thanks @staabm!FileHelpermethods with BC promise (phpstan/phpstan-src@4f9488e), #5306Bugfixes 🐛
array_walkalso understandsobject(#573), thanks @niconoe-!Function signature fixes 🤖
next()dynamic return type extension also valid forprev()(phpstan/phpstan-src@2fd7bfeobject(phpstan/phpstan-src@a056d34)Memcached::deleteMulti(#582), thanks @paulbalandan!v0.12.92Compare Source
Improvements 🔧
non-empty-stringtype (phpstan/phpstan-src@6ef5e91), #4711, #3981checkPhpDocMissingReturn: falsemore strict (phpstan/phpstan-src@2656081)nikic/php-parserto work on PHP 8.1 again (phpstan/phpstan-src@0f8ead7), #5263Bleeding edge 🔪
If you want to see the shape of things to come and adopt bleeding edge features early, you can include this config file in your project's
phpstan.neon:Of course, there are no backwards compatibility guarantees when you include this file. The behaviour and reported errors can change in minor versions with this file included. Learn more
Bugfixes 🐛
!empty()leads tonon-empty-string(phpstan/phpstan-src@790a838), #5258ClassReflection::getInterfaces()(phpstan/phpstan-src@cd02bf8), #4854Function signature fixes 🤖
explode()always returnsnon-empty-array(phpstan/phpstan-src@25260db)sscanf()signature (#567), thanks @fluffycondor!v0.12.91Compare Source
Improvements 🔧
php.iniin child workers (#559), thanks @yangchaobj!strval()dynamic return type extension (#568), thanks @jlherren!intval(),boolval(),floatval()(#570), #4848, #5162, thanks @jlherren!next()dynamic return type extension (phpstan/phpstan-src@599f59b), #5253nikic/php-parserto 4.11.0 (phpstan/phpstan-src@e42ae89)Bugfixes 🐛
objectforReflectionClassandReflectionMethodconstructor throw types (#566), #5195, thanks @VincentLanglet!!empty(#569), #3784, #3700, #3297, thanks @ArtemGoutsoul!v0.12.90Compare Source
Improvements 🔧
getTraits()recursive (#557), thanks @IAmRGroot!Bleeding edge 🔪
If you want to see the shape of things to come and adopt bleeding edge features early, you can include this config file in your project's
phpstan.neon:Of course, there are no backwards compatibility guarantees when you include this file. The behaviour and reported errors can change in minor versions with this file included. Learn more
Bugfixes 🐛
neverreturn type in PHPDoc wins over native type (phpstan/phpstan-src@2c976fb), #5089ClosureTypetypeOnly description is justClosure(phpstan/phpstan-src@476520d), #5164BenevolentUnionType(phpstan/phpstan-src@2abb92e), #5169Function signature fixes 🤖
nullforfile_put_contents()$contextargument (#558), thanks @steevanb!v0.12.89Compare Source
Improvements 🔧
ExceptionTypeResolveras an interface allowing for custom implementations (phpstan/phpstan-src@a125304, phpstan/phpstan-src@dec03af), #5044RecursiveArrayIterator(phpstan/phpstan-src@8c33955)Bleeding edge 🔪
int|string(phpstan/phpstan-src@724c8ba), #3753If you want to see the shape of things to come and adopt bleeding edge features early, you can include this config file in your project's
phpstan.neon:Of course, there are no backwards compatibility guarantees when you include this file. The behaviour and reported errors can change in minor versions with this file included. Learn more
Bugfixes 🐛
TARGET_PROPERTYattributes on promoted properties (#528), #4418, thanks @dbrekelmans!IntegerRangeType(phpstan/phpstan-src@d23b4b7)Function signature fixes 🤖
implode()with named arguments (phpstan/phpstan-src@18f8473), #5018intdiv()throw extension (#527), thanks @VincentLanglet!SimpleXMLElementconstructor throw type extension (#532), thanks @VincentLanglet!uopz_set_hookfixes (phpstan/phpstan-src@4effc89)gmp_div,odbc_execandunregister_tick_function(#533), thanks @danielmarschall!phpstorm-stubs(phpstan/phpstan-src@bba6631)stream_bucket_make_writeable(#537), thanks @bytestream!toPHPoptional (#543), thanks @franmomu!SplFileObject::fgetcsv()(#479), thanks @VincentLanglet!mysqli_get_client_version()(#545), thanks @johnbillion!number_format(#553), thanks @BackEndTea!v0.12.88Compare Source
Improvements 🔧
editorUrlto add clickable file URLs to output (#515), thanks @ThomasLandauer!Bugfixes 🐛
proc_openfunction is disabled (#514), thanks @mvorisek!excludePathsin the same config hierarchy (phpstan/phpstan-src@e7ac788), #4561\is valid class name (phpstan/phpstan-src@428baf5), #5002is_array()false positive (phpstan/phpstan-src@187921e), #4999TemplateUnionTypeas part of intersection (phpstan/phpstan-src@4a45db5), #5000*ignore path whenopen_basediris set (#519), thanks @mvorisek!Function signature fixes 🤖
number_format()with named arguments (#524), thanks @matyx!DateIntervalextension (#520), thanks @VincentLanglet!v0.12.87Compare Source
Major new feature 🚀
New exceptions-related rules
@throws@throwsthat aren't actually thrownRead this article for more details »
Improvements 🔧
composer/xdebug-handler(phpstan/phpstan-src@0b6b602)Bugfixes 🐛
throwexpression throw point (phpstan/phpstan-src@1e4f2e1)Function signature fixes 🤖
getopt()return type (phpstan/phpstan-src@94b6c03), #4987, thanks @dktapps!v0.12.86Compare Source
Improvements 🔧
@throwssupport (phpstan/phpstan-src@48bfa70)Bugfixes 🐛
new ReflectionClass()can throwReflectionException(phpstan/phpstan-src@00d3ef4)DateTimeandDateTimeImmutableconstructor does not always throw Exception (phpstan/phpstan-src@181f75c)Function signature fixes 🤖
wincache_ucache_incandwincache_ucache_dec(phpstan/phpstan-src@671f404), #4952Redis::scan()signature (phpstan/phpstan-src@8fe9e60), #4929IntlDateFormatter::parsecan define variable by reference (#509), thanks @francescolaffi!v0.12.85Compare Source
Improvements 🔧
Bugfixes 🐛
===and!==type inference withtreatPhpDocTypesAsCertain: false(#476), thanks @ruudk!yieldhas implicit throw point (phpstan/phpstan-src@033aeff), #4863is_dir()and similar function values for nonexistent files (phpstan/phpstan-src@1eaef04), #4816Function signature fixes 🤖
date_create_from_formatanddate_create_immutable_from_format(#502), thanks @pascalheidmann!v0.12.84Compare Source
Major new feature 🚀
Local type aliases
Thanks to @jiripudil and his PR https://github.com/phpstan/phpstan-src/pull/460, you can now enjoy
@phpstan-typeand@phpstan-import-typein class-level PHPDoc. See the documentation for more details.Improvements 🔧
AlwaysUsedClassConstantsExtensioninterface (#495), #4859, thanks @jdecool!Bugfixes 🐛
unlink()also clears stat cache (phpstan/phpstan-src@63d0670), #4797Closure::bind()(phpstan/phpstan-src@566b44b), #4808new $expr()(phpstan/phpstan-src@8463afd), #4806$expr::foo()(phpstan/phpstan-src@8c7cf85), #4805require/require_oncefor #4836 via a fake read (#491), thanks @rrazor!Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.